<template>
  <el-container class="app-container">
    <el-aside width="200px" v-if="userStore.token">
      <navigation-bar />
    </el-aside>
    <el-container class="main-container">
      <!-- 添加系统标题和样式 -->
      <el-header v-if="userStore.token" class="main-header">
        <div class="header-content">
          <h1 class="system-title">交通违法识别管理系统</h1>
          <span class="system-subtitle">实时监控 · 智能分析</span>
        </div>
      </el-header>
      <el-main class="content-area">
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup>
import NavigationBar from '@/components/NavigationBar.vue'
import UserAvatarDropdown from '@/components/UserAvatarDropdown.vue'
import { useUserStore } from '@/store/user'

const userStore = useUserStore()
</script>

<style scoped>
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2c3e50;
    min-height: 100vh;
    background-color: #f0f2f5;
}

/* 全局边距 */
body {
    margin: 0;
    padding: 0;
}

/* 全局卡片样式 */
.el-card {
    margin-bottom: 20px;
}

/* 全局表格样式 */
.el-table {
    margin-top: 20px;
}

/* 全局表单样式 */
.el-form {
    margin-top: 20px;
}

/* 全局按钮间距 */
.el-button+.el-button {
    margin-left: 10px;
}

/* 全局标签样式 */
.el-tag {
    margin-right: 5px;
}

.app-container {
  min-height: 100vh;
  display: flex;
}

.main-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* 顶部导航栏样式 */
.main-header {
  background: linear-gradient(90deg, #1a365d 0%, #2c5282 100%);
  color: white;
  padding: 0 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 60px; /* 固定高度 */
}

.header-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.system-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 500;
}

.system-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
}
</style>
